Copyright: Copyright ©Calitz Bros


BandIt Help Contents
BandIt - Report Writer for Delphi

Copyright Reserved (c) - Calitz Bros 1997

The Components

TCBReport	Main Report component
TCBBand	Main bands component - Used for all types except Detail
TCBDetailBand	Detail bands component - Used for detail of Master-Detail Reports or Detail Reports
TCBSubDetBand	Used for Printing additional detail for the TCBDetailBand e.g. Headers, footers, totals etc.
TCBLabelBand	Used for printing labels
TCBCalc	Perform Calculations on database fields
TCBSystem	Supply System Information

The Print Viewer

 The Print Viewer

Bandit now supports printing of RichText and the ChartFX component

Additional Information

 What does CB Print Compatible mean?

 Making your custom components CB Print Compatible

 Examples of components made CB Print Compatible

 Order Information

 Multi-Language Support

 BandIt Layout

Types

About


Ordering Information

Software Registration of Calitz Bros. software

Cost of registration (as of 1 January 1996)

PRODUCT DESCRIPTION	PRICE
Aha file print utility 16 & 32 bit V5.X	$20
Sortit Grid components 16 & 32 bit V5.X	$50
GraphIt components 16 & 32 bit V5.X	$50
PrintIt components 16 & 32 bit V5.X	$50
ReportIt components 16 & 32 bit V5	$50
BandIt components 16 & 32 bit V5.X	$75
CB Suite 16 & 32 bit V5.X (Contains Sortit, GraphIt, PrintIt, ReportIt and BandIt	$150

Registered users of Sortit, GraphIt, PrintIt ,ReportIt or BandIt can contact Calitz Bros for details on how to upgrade to CB Suite at a reduced price.

How to register

For technical support or comments about any of these products, contact Calitz Bros. via E-Mail.

We make use of shareware payment processing services which ONLY handle orders for us.

For your convenience we now have four services through which you can register your copy of Calitz Bros. shareware, namely :

 ShareIt

 Kagi Software

 NorthStar Solutions

 Compuserve

1. ShareIt!

If you would like to register our products, you can do the registration online on the Internet at http://www.shareit.com and enter the program number there or select the Register Now icon next to the product name.

If you do not have access to the Internet, you can register via phone, fax or postal mail. Please print out the following form, and fax or mail it to:

Reimold & Schumann Internet Services

ShareIt!

Jahnstrasse 24

50676 Koeln Germany

Phone: +49-221-2407279 or +49-172-7229837

Fax: +49-221-2407278

E-Mail: register@shareit.com

Registration form for __________ (Product Name)

Program No.: __________ (Product Number)

Last name: ___________________________________

First name: ____________________________________

Street and #: ______________________________________

City, State, postal code: ________________________________

Country: _______________________________________

Phone: _____________________________________

Fax: ________________________________________

E-Mail: ______________________________________

How would like to receive the registration key/full version?

e-mail - fax - postal mail

How would you like to pay the registration fee :

credit card - money transfer - EuroCheque - cash

Credit card information (if applicable)

Credit card: Visa - Eurocard/Mastercard - American Express - Diners Club

Card holder: ________________________________

Card No.: ___________________________________

Date of Expiration : ___________________________________

Date / Signature ___________________________

     2. Kagi Software

     You may place your order through Kagi Software by E-Mail (encrypted), Fax or Postal Mail. They accept payment in cash, checks, money orders, Visa Card, Master Card and American Express Card.

     Use the supplied REGISTER.EXE program to order through Kagi Software and follow the on- line prompts.

3. NorthStar Solutions

NorthStar Solutions can easily be contacted FOR ORDERS ONLY via any of the following methods:

PHONED ORDERS:

Calls are taken 10 am - 8 pm, EST, Monday through Saturday

1-800-699-6395 (Calls from the U.S. only)

1-803-699-6395

FAXED ORDERS:

1-803-699-5465 (Available 24 hours. International and business orders encouraged.)

E-MAILED ORDERS:

America On-line: STARMAIL

Compuserve: 71561,2751

Internet: 71561.2751@compuserve.com

MAILED ORDERS:

You may register with a check or money order (U.S. currency) Make them payable  to  NorthStar Solutions  and send them to :

NorthStar Solutions

PO Box 25262

Columbia, SC 29224

Please provide (or be prepared to provide) the following information when ordering:

The program you are registering.

Your mailing address

Your Visa, MasterCard, or Discovery # and its expiration date (if using credit card).

Your E-Mail address (so NorthStar Solutions can send you E-Mail confirming  your order and so we can contact you to send you your registration codes and any important follow-up information, upgrade announcements,  etc. )

4. Compuserve

Go SWREG and use the following Registration ID's:

PRODUCT	REGISTRATION ID
Aha	11670
CB Grid  (SortIt)	13063
PrintIt	11546
ReportIt	11547
BandIt	14287
CBSuite	14162

Benefits of registration

Minor upgrades and bug fixes are free to registered users.

Registered users are informed of upgrades and new software releases.

Registered users may supply the components royalty-free in their source code.

Registered users will receive an activation code that deactivates nag screens  or nag messages on printouts.

On receipt of your order details, we will supply you a activation code by either e-mail, fax or postal mail that disables all nag screens and/or printouts.

Please note that we do not supply source code of our components !


TCBReport Events

OnAfterDetail

OnBeforeDetail

OnAfterPrint

OnBeforePrint

OnEndPage

OnFilter

OnNewColumn

OnNewPage

OnPrint

OnPrintPage

OnStartPage


Layout of a TCBReport

The CBReport component is 1st placed on the form.  Bands are then placed on the CBReport component. The links to the bands are entered in the CBReport's properties. At any stage during design time you can right-click on the CBReport object to view the report in the Viewer.

Example 1

Place a CBReport component on a Form

Drag 3 CBBand components onto the CBReport

Change the name of the First CBBand to PageHeader and its BandType to cbPageHeader

Change the name of the 2nd CBBand to Title and its BandType to cbTitle

Change the name of the 3rd CBBand to PageFooter and its BandType to cbPageFooter

Click on the CBReport and set the bands to point to the 3 bands we placed on the CBReport

Right-click on the CBReport and select a 1 Page view to view the empty report thus far

Now place a few components on the 3 bands - enlarge or reduce their size as necessary e.g.

Right-click on the CBReport and you can print your report.


TCBReport MarginRight

Applies to

TCBReport Component

Declaration

property Page.MarginRight: double

Description

Indicates the border on the right side of the page where there should be no printing. Measurements are in Inches or Centimetre depending on the setting of Units.


TCBReport MarginLeft

Applies to

TCBReport Component

Declaration

property Page.MarginLeft: Double

Description

Indicates the border on the left side of the page where there should be no printing. Measurements are in Inches or Centimetre depending on the setting of Units.


TCBReport ExecuteEntity

Applies to

TCBReport Component

Declaration

procedure ExecuteEntity (Count: Integer);;

Description

Executes a TCBReport for Count number of Entities. A entity can be a Master Band with all attached Detail Band, a Single Master Band, a Single Detail Band, etc.


Multi Language Support

Applies to

TCBReport component

Description

Multi Language Support allows the programmer to change the text on the buttons and Dialog boxes which are used in the Viewer.

To change the langauge do the following:

Make sure your PATH includes the DELPHI\BIN directory because the BORLAND RESOURCE COMPILER (BRC) is easiest to run from a DOS prompt. If not set you will get a "Bad Command or File name Error"

 Edit the file named STRING.RC in the BandIt component directory

 Compile the file with the Borland Resource compiler e.g.

      BRC  -r STRING.RC

 Include the generated .RES file in your main application

      {$R STRING.RES}

(The best is to include it like this

implementation

{$R *.DFM}

{$R STRING.RES}

 Recompile and link your application


TCBSystem Component

Properties

Unit

CBSystem

Description

TCBSystem components are components that can display system information on the printer. Options are Date, Time, DateTime, PageNumber,


TCBCalc Component

Properties

Unit

CB_Calc

Description

TCBCalc is a component which can do calculations on database fields. It is used for displaying totals, average, counts, max and minimum values of database fields.


TCBBand Properties

The properties which are greyed out (like this) are normal Delphi properties which works as for Delphi.

Align

BandType

Color

Cursor

DataSource

Enabled

Font

ForceNewPage

Frame

Bottom

Color

Left

Right

Top

Height

HelpContext

Hint

Left

Name

ParentFont

PrintBkColor

Tag

Top

Width


what is print awareness
What is CB Print Compatible

BandIt, PrintIt and CBSuite all share the ability to print 3rd party components as well as most of the native visual components from Delphi. This means that components can now be mixed from the component bar and they will be printed as is.  A TPanel can be printed and on top of it any supported component e.g. another TPanel on top of it, etc. If a 3rd Party component is CB Print Compatible then it will also be printed automatically in the right position and the right size e.g. on top of a TPanel.

Some of the components that are CB Print Compatible are TLabel, TEdit, TMaskEdit, TMemo, TCheckBox, TComboBox, TRadioButton, TImage, TShape, TBevel, TDBText, TDBEdit, TDBMemo, TDBImage, TDBComboBox, TDBCheckBox, TDBLookupCombo.

Any of the supported components placed on a TGroupBox, TRadioGroup, TPanel, TScrollBox, or TForm can be printed. Any of the TGroupBox, TRadioGroup, TPanel, TScrollBox components can in turn be placed on any of these components (like in Delphi) and be printed.

Any third Party component can now be printed if they are CB Print Compatible.


BandType Property

Applies to

TCBBand and TCBDetailBand Components

Declaration

property BandType: CBandType read FBandType write SetBandType;

Description

Indicates the Type of band. Options are

cbTitle

cbMaster

cbDetail

cbDetailFooter

cbDetailHeader

cbPageFooter

cbPageHeader

cbSummary


OutputTo Property

Applies to

TCBReport component

Declaration

property OutputTo TOutput;

Description

Indicates where the output will be sent to. This can take on the values of poPrinter or poViewer.


ForceNewPage Property

Applies to

 TCBDetailBand  and TCBBand Components

Declaration

property ForceNewPage: Boolean read FForceNewPage write FForceNewPage;

Description

Indicates if there must be a Page eject before printing this band


TCBBand Component

Properties

Unit

CBBand

Description

TCBBand components are the bands which contains the components that can be printed. Use the BandType property to set the type of the specific band. If Master-Detail reports or Detail reports are required, use the TCBDetailband component for the Detail part.

Master-Detail reports can be printed to any depth desired.

Note: It must have it's DataSource property set if the DataType is set to cbMaster


TCBReport Execute

Applies to

TCBReport Component

Declaration

procedure Execute;

Description

Executes a TCBReport


TCBReport OnAfterPrint
OnAfterPrint Event

Applies To

TCBReport Component

Declaration

property OnAfterPrint: TNotifyEvent;

Description

The OnAfterPrint event occurs after the complete Report has been printed. Your application can use this event to do any necessary cleanup.


TCBReport OnBeforePrint
OnBeforePrint Event

Applies to

TCBReport Component

Declaration

property OnBeforePrint:  TNotifyEvent;

Description

The OnBeforePrint event occurs before anything has been printed. Your application can use this event to do any necessary initialization.


TCBReport OnNewPage
OnNewPage Event

Applies to

TCBReport Component

Declaration

property OnNewPage:  TNotifyEvent;

Description

The OnNewPage: event occurs before a new page starts printing. Your application can use this event to do any necessary cleanup per page.


TCBReport OnPrint Event

TCBReport Component

Declaration

property OnPrint:  TNotifyEvent;

Description

The OnPrint event occurs before printing starts for each page. Your application can use this event to do any necessary initialization


TCBReport OnPrintPage
OnPrintPage Event

TCBReport Component

Declaration

property OnPrintPage: TNotifyEvent;

Description

The OnPrintPage event occurs before the page is printed. Your application can use this event to do any necessary initialization


OnPrintFooter Event

Applies to

TCBReport Component

Declaration

property OnPrintFooter: TNotifyEvent;

Description

The OnPrintFooter event occurs before the footer is printed. Your application can use this event to do any necessary initialization


About Property

Applies to

TCBReport component

Declaration

property About  string

Description

Contains the version number of the product


Viewer.Heading Property

Applies to

TCBReport Component

Declaration

property Viewer.Heading: string;

Description

Indicates the Window header when using the Print Viewer.


DetailHeaderBand Property

Applies to

 TCBDetailBand Component

Declaration

property  DetailHeaderBand: TCBCustomBand read FDetailFooterBand write SetDetailFooterBand;

Description

Indicates which header band will be used for a specific TCBDetailBand. Each TCBDetailBand may have its own DetailFooterBand and DetailHeaderband. A DetailHeaderband or DetailFooterBand are optional.


Examples of Components made BandIt and CBSuite aware
Examples of Components made CB Print Compatible

There are 2 example components included with BandIt, PrintIt and CBSuite which shows the Component Writer how to make his/her component CB Print Compatible

 Example of a component derived from a TCustomControl - This can be found in the CBTESTS.PAS file in the BandIt Demo directory.

  Example of a component derived from a TCBGraphicControl - This can be found in the CBTESTS2.PAS file in the BandIt Demo directory.


Frame Property

Applies to

TCBBand and TCBDetailBand components

Declaration

property FrameStyle: TFrames;

Description

Determines the style of frame which will be drawn around bands Valid values are

frDoubleThick

frDoubleThickThin

frDoubleThin

frDoubleThinThick

frNone

frSingleThick

frSingleThin


TCBReport Page.MarginTop
Page.MarginTop Property

Applies to

TCBReport Component

Declaration

property Page.MarginTop: double;

Description

Indicates the border in Inches or Centimetre on the top side of the page where there should be no printing.

Measurements are in Inches or Centimetre depending on the setting of Units.


TCBReport Properties

The properties which are greyed out (like this) are normal Delphi properties which works as for Delphi.

About

AboutRegistered

Align

Bands

Brush

Color

Copies

Cursor

Enabled

Font

Height

HelpContext

Hint

Left

LineSpacing

Name

Orientation

OutputTo

Page

ParentFont

Tag

Top

Units

Viewer

Width


ResetAfterBand Property

Applies to

TCBCalc Component

Declaration

property ResetAfterBand: TCBCustomBand read FResetAfterBand write SetResetAfterBand;

Description

This indicates after which band is printed, the component will be reset to a zero value.


Operation Property

Applies to

TCBCalc Component

Declaration

property Operation: CBOperation read FOperation  write SetOperation;

Description

This indicates which operation this TCBCalc component should perform. The options are

cbCount

cbAverage

cbMax

cbMin

cbSum


LineSpacing

Applies to

TCBReport Component

Declaration

property LineSpacing: String

Description

Indicates the distance between two lines. A value of 1.0 would insert the height of the text in between the two lines.


Units Property

Applies to

TCBReport Component

Declaration

property Units: TUnits;

Description

Indicates the measurement system which must be used. Allowed values are:

poInches

poCentimetres


Viewer.BkColor Property

Applies to

TCBReport component

Declaration

property Viewer.BkColor: TColor;

Description

Indicates the background color which will be used when using the Print Viewer .


Make CBSuite and BandIt aware
Make CB Print Compatible

In order for a 3rd Party component to be CB Print Compatible, the following must be added to a component:

If the component was derived from a TGraphicControl:

The component's base class must be changed to be derived from a TCBGraphicControl. This adds a single virtual method to the TGraphicControl namely:

procedure PrintWindow( var CBPrint: TCBPrint ); virtual;

The component writer then must override this method to paint the control on the printer (similar to the Paint method which is used to paint the component on the Canvas). When the time comes to print the component, this function will be called. For an example on how to do this, see the CBTests2.pas file which contains such a component.

If the component was derived from a TWinControl or any of its derived classes:

When the time comes to print the Control, a CB_PRINT message will be sent to the Control as follows:

SendMessage(Control.Handle, CB_PRINT,0,LongInt(@CBPrint));

The component must then paint itself onto the printer (like the Paint method). For an example on how to do this, see the CBTests.pas file which contains such a component.

The TCBPrint class is defined as follows:

type

TCBPrint = class

Point: TPoint;

Rect: TRect;

Gdi: TGdi;

end;

TGdi is the class that contains all the print methods which are necessary to print the component. The component writer uses these methods as if he was painting on the Canvas. Even the coordinates that he uses are the same as if he was printing to the Canvas. The TGdi class takes care of the scaling, etc.


DetailFooterBand Property

Applies to

 TCBDetailBand Component

Declaration

property  DetailFooterBand: TCBCustomBand read FDetailFooterBand write SetDetailFooterBand;

Description

Indicates which footer band will be used for a specific TCBDetailBand. Each TCBDetailBand may have its own DetailFooterBand and DetailHeaderband. A DetailHeaderband or DetailFooterBand are optional.


TCBDetailBand Properties

The properties which are greyed out (like this) are normal Delphi properties which works as for Delphi.

Align

BandType

Color

Cursor

DataSource

DetailFooterBand

DetailHeaderband

Enabled

Font

ForceNewPage

Frame

Bottom

Color

Left

Right

Top

Height

HelpContext

Hint

Left

Name

NextDetailBand

ParentFont

PrintBkColor

Tag

Top

Width


Support

Support is available from the following:

E-mail:	calitzbros@2-hot.com

Internet home page	http://calitzbros.simplenet.com

Fax	+27 12 342 5269


TCBSystem Properties

The properties which are greyed out (like this) are normal Delphi properties which works as for Delphi.

Alignment

BorderStyle

Color

Cursor

Data

DisplayFormat

Font

Height

HelpContext

Hint

Left

Name

ParentFont

Tag

Text

Top

Visible

Width


Data Property

Applies to

TCBSystem Component

Declaration

property Data: CBData read FData  write SetData;

Description

This indicates which data this TCBSystem component should perform. The options are

cbTime

cbDate

cbDateTime

cbPageNumber


NextDetailBand Property

Applies to

 TCBDetailBand  Component

Declaration

property NextDetailBand: TCBBeforeDetail read FNextDetailBand write SetNextDetailBand;

Description

Indicates the next TCBDetailBand that will be printed after the current one.


TCBCalc Properties

The properties which are greyed out (like this) are normal Delphi properties which works as for Delphi.

Alignment

BorderStyle

Color

Cursor

DataField

DataSource

DisplayFormat

Font

Height

HelpContext

Hint

Left

Name

Operation

ParentFont

ResetAfterBand

Tag

Text

Top

Visible

Width


TCBReport Methods

Execute

ExecuteEntity


PrintViewer

The PrintViewer is built into the BandIt components and can view and prints files that are generated by BandIt. It is called from within the BandIt components.

It looks in the current directory for all metafiles beginning with PRN and displays them on the screen. It has built in functions like ZOOM, PAN etc.


Types

Unit

CB_Types

Description

All the types  are in unit CB_Types. If you are coming from an earlier version of BandIt then please make sure that this unit is included.

The following types are used:

  TPosition = 	(poLeft, poCenter, poRight);

  TUnits = 	(poInches, poCentimetres);

  TOutput = 	(poPrinter, poViewer);

  TOrient = 	(Default, Landscape, Portrait);

  TFrameStyles = 	(frNone, frSingleThick, frSingleThin, frDoubleThick, frDoubleThin,  frDoubleThickThin,frDoubleThinThick);

  TPagesToPrint = 	(pAll, pOdd, pEven);


Interrupted Property

Applies to

TCBReport Component

Declaration

property Interrupted  Boolean;

Description

Indicates if the prepare of the printout or the printing on the printer was interrupted. Default is False.


Orientation

Applies to

TCBReport Component

Declaration

property Orientation TOrient;

Description

Indicates the orientation of the output on either the Viewer or the printer. This can take on the values of Default, Landscape or Portrait.


TCBDetailBand Component

Properties

Unit

CBDetBan

Description

The TCBDetailBand is used to print detail of a DataSource. The TCBDetailBand does not need a Master Band to operate. It must be linked in the TCBReport Bands property. It can function together with a Master band. It can point to another DetailBand which in turn can point to another.

The TCBDetailBand can be linked to a DetailHeader and/or DetailFooter (which are TCBBand components)

The TCBDetailBand moves through the DataSource and prints all selected records.

Note: It must have it's DataSource property set


TCBReport Component

Properties	Events	Methods

Unit

CBReport

Description

TCBReport is the controlling component for BandIt reporting. A TCBReport is the 1st BandIt component which is placed on the form as all other BandIt components are placed on top of the TCBReport. The band components are then placed on the TCBReport and any necessary components on top of these.

The bands can contain normal Delphi controls like TPanel, TEdit, TLabel, TMemo, TImage, TDBEdit, TDBImage, TCheckBox, TRadioButton, TRadioGroup, etc. These will be printed as they appear. The bands can also contain the TCB_Graph or TCB_DBGraph components from Calitz Bros which will also be printed.

3rd Party components which has been made CBSuite and BandIt print aware can also be placed on the bands and they will be printed.

The Page Layout can be set with the Page properties. The OutputTo property is used to set the destination of the report

Master-Detail reports can be printed to any depth desired.


AboutRegistered Property

Applies to

TCBReport component

Declaration

property About  string

Description

Contains information about who the product is registered to.


Bands Properties

Applies to

TCBReport component

Declaration

This property group contains the following sub-properties:

Detail

Master

Overlay

PageFooter

PageHeader

Summary

Title

Description

The bands which should be printed must be entered here. All of the bands are optional. If you want to print a single record or a few components you can place them on a TCBBand with a cbTitle BandType.

If you want to print a few records with no detail relationship, you need only use a TCBBand with a BandType set to cbMaster. The band must have its Datasource property set to be able to move through the Table or Query. The Master property must be set under Bands in TCBReport.

If you want to print a Master-Detail relationship, use the same setup as the previous example, just add a TCBDetailBand and set its Datasource property. Link the TCBReport's Bands.Detail property to the TCBDetailBand. If you want to add another detail level, add another TCBDetailBand and link the previous one to the next one.